package com.xbongbong.pro.message.enums;

import com.xbongbong.saas.enums.XbbRefTypeEnum;

/**
 * 消息推送用
 * @author 魏荣杰
 * @date 2019/2/22 13:52
 * @since v1.0
 * @version v1.0
 */
public enum RefEntityEnum {
    /**
     * 客户
     */
    CUSTOMER_ENTITY(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode()),
    CUSTOMER_BACK_REMIND(XbbRefTypeEnum.CUSTOMER_BACK_REMIND.getCode()),
    CUSTOMER_TRANSFER_REMIND(XbbRefTypeEnum.CUSTOMER_TRANSFER_REMIND.getCode()),
    CUSTOMER_STAGE(XbbRefTypeEnum.CUSTOMER_STAGE.getCode()),
    /**
     * 联系人
     */
    CONTACT_ENTITY(XbbRefTypeEnum.CONTACT.getCode()),
    /**
     * 销售机会
     */
    SALES_OPPORTUNITY_ENTITY(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode()),
    /**
     * 访客计划
     */
    COMMUNICATE_PLAN_ENTITY(XbbRefTypeEnum.COMMUNICATE_PLAN.getCode()),
    /**
     * 跟进记录
     */
    CUSTOMER_COMMUNICATE_ENTITY(XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode()),
    /**
     * 合同
     */
    CONTRACT_ENTITY(XbbRefTypeEnum.CONTRACT.getCode()),
    CONTRACT_REMIND(XbbRefTypeEnum.CONTRACT_REMIND.getCode()),
    /**
     * 应收款
     */
    PAYMENT(XbbRefTypeEnum.PAYMENT.getCode()),
    /**
     * 报价单
     */
    QUOTATION(XbbRefTypeEnum.QUOTATION.getCode()),

    /**
     * 报价单提醒
     */
    QUOTATION_REMIND(XbbRefTypeEnum.QUOTATION_REMIND.getCode()),

    /**
     * 回款单
     */
    PAYMENT_SHEET(XbbRefTypeEnum.PAYMENT_SHEET.getCode()),
    /**
     * 红冲回款单
     */
    RED_PAYMENT_SHEET(XbbRefTypeEnum.RED_PAYMENT_SHEET.getCode()),
    /**
     * 坏账回款单
     */
    BAD_PAYMENT_SHEET(XbbRefTypeEnum.BAD_DEBT.getCode()),
    /**
     * 预收款
     */
    PREPAYMENT(XbbRefTypeEnum.PREPAYMENT.getCode()),
    /**
     * 红冲预收款余额
     */
    RED_PREPAYMENT(XbbRefTypeEnum.RED_PREPAYMENT.getCode()),
    /**
     * 未回款提醒
     */
    PAYMENT_REMIND(XbbRefTypeEnum.PAYMENT_REMIND.getCode()),
    /**
     * 逾期回款提醒
     */
    PAYMENT_OVERDUE(XbbRefTypeEnum.PAYMENT_OVERDUE.getCode()),
    /**
     * 发票
     */
    INVOICE_ENTITY(XbbRefTypeEnum.INVOICE.getCode()),
    /**
     * 红冲发票
     */
    RED_INVOICE(XbbRefTypeEnum.RED_INVOICE.getCode()),

    /**
     * 进项发票
     */
    PURCHASE_INVOICE_ENTITY(XbbRefTypeEnum.PURCHASE_INVOICE.getCode()),

    /**
     * 红冲发票
     */
    RED_PURCHASE_INVOICE(XbbRefTypeEnum.RED_PURCHASE_INVOICE.getCode()),
    /**
     * 销售简报
     */
    SALES_REPORT_ENTITY(XbbRefTypeEnum.SALES_REPORT_ENTITY.getCode()),
    /**
     * 工作报告
     */
    WORK_REPORT_ENTITY(XbbRefTypeEnum.WORK_REPORT.getCode()),
    /**
     * 签到
     */
    SIGN_IN(XbbRefTypeEnum.SIGNIN.getCode()),
    /**
     * 产品
     */
    PRODUCT_ENTITY(XbbRefTypeEnum.PRODUCT.getCode()),
    /**
     * 采购合同
     */
    PURCHASE_ENTITY(XbbRefTypeEnum.PURCHASE.getCode()),
    /**
     * 入库单
     */
    INSTOCK_ENTITY(XbbRefTypeEnum.INSTOCK.getCode()),
    /**
     * 出库单
     */
    OUTSTOCK_ENTITY(XbbRefTypeEnum.OUTSTOCK.getCode()),
    /**
     * 供应商
     */
    SUPPLIER_ENTITY(XbbRefTypeEnum.SUPPLIER.getCode()),
    /**
     * BOM清单
     */
    BOM_ENTITY(XbbRefTypeEnum.BOM_BILL.getCode()),
    /**
     * 生产单
     */
    PRODUCTION_ORDER_ENTITY(XbbRefTypeEnum.PRODUCTION_ORDER.getCode()),
    /**
     * 退货退款
     */
    REFUND_ENTITY(XbbRefTypeEnum.REFUND.getCode()),
    /**
     * 采购退货单
     */
    RETURNED_PURCHASE_ENTITY(XbbRefTypeEnum.RETURNED_PURCHASE.getCode()),
    /**
     * 审批
     */
    APPROVAL_ENTITY(XbbRefTypeEnum.APPROVAL.getCode()),
    /**
     * 工单
     */
    WORKORDER_ENTITY(XbbRefTypeEnum.WORK_ORDER.getCode()),
    /**
     * SFA
     */
    AI_ASSISTANT(XbbRefTypeEnum.AI_ASSISTANT.getCode()),
    /**
     * 系统通知
     */
    SYSTEM_NOTIFICATION_ENTITY(XbbRefTypeEnum.SYSTEM.getCode()),
    /**
     * 导出
     */
    EXPORT(XbbRefTypeEnum.EXPORT.getCode()),
    /**
     * 导出失败
     */
    EXPORT_FAIL(XbbRefTypeEnum.EXPORT_FAIL.getCode()),

    /**
     * 付款计划
     */
    PAY_PLAN(XbbRefTypeEnum.PAY_PLAN.getCode()),
    /**
     * 未付款提醒
     */
    PAY_PLAN_REMIND(XbbRefTypeEnum.PAY_PLAN_REMIND.getCode()),
    /**
     * 逾期付款提醒
     */
    PAY_PLAN_OVERDUE(XbbRefTypeEnum.PAY_PLAN_OVERDUE.getCode()),
    /**
     * 付款单
     */
    PAY_SHEET(XbbRefTypeEnum.PAY_SHEET.getCode()),
    /**
     * 红冲付款单
     */
    RED_WRITE_OFF_PAY(XbbRefTypeEnum.RED_WRITE_OFF_PAY.getCode()),
    /**
     * 坏账付款单
     */
    BAD_PAY(XbbRefTypeEnum.BAD_PAY.getCode()),
    /**
     * 预付款
     */
    PREPAY(XbbRefTypeEnum.PREPAY.getCode()),
    /**
     * 红冲预付款余额
     */
    RED_PREPAY(XbbRefTypeEnum.RED_PREPAY.getCode()),

    /**
     * 线索
     */
    CLUE_ENTITY(XbbRefTypeEnum.CLUE.getCode()),
    CLUE_BACK_REMIND(XbbRefTypeEnum.CLUE_BACK_REMIND.getCode()),
    CLUE_STAGE(XbbRefTypeEnum.CLUE_STAGE.getCode()),

    /**
     * 数据中心
     */
    DATA_CENTER(XbbRefTypeEnum.DATA_CENTER.getCode()),
    DATA_WARNING(XbbRefTypeEnum.DATA_WARNING.getCode()),

    /**
     * 回款计划
     */
    PAYMENT_TASK_ENTITY(XbbRefTypeEnum.PAYMENT_TASK.getCode()),

    /**
     * 经销商联系人
     */
    DISTRIBUTOR_CONTACT_ENTITY(XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode()),

    /**
     * 经销商跟进记录
     */
    DISTRIBUTOR_COMMUNICATE_ENTITY(XbbRefTypeEnum.DISTRIBUTOR_COMMUNICATE.getCode()),

    UNKNOWN(XbbRefTypeEnum.UNKNOWN.getCode());


    /**
     * 枚举值 --
     */
    private final int code;

    /**
     * 构造一个枚举对象
     *
     * @param code  枚举值
     */
    RefEntityEnum(int code) {
        this.code = code;
    }

    /**
     * @return Returns the code.
     */
    public int getCode() {
        return code;
    }

    /**
     * 通过枚举 code 获得枚举
     *
     * @param code 枚举类型英文别名
     *
     * @return RefEntityEnum
     */
    public static RefEntityEnum getByCode(Integer code) {
        for (RefEntityEnum cacheCode : values()) {
            if (code.equals(cacheCode.getCode())) {
                return cacheCode;
            }
        }
        return UNKNOWN;
    }
}
